import pymysql

con = pymysql.connect(host="localhost",user="root",password="",database="company")

cursor = con.cursor()

for i in range(10):
    sql = "insert into person values(%s,%s,%s,%s)"
    param = [input(f"请输入第{i+1}个用户名："),input(f"请输入第{i+1}个年龄："),input(f"请输入第{i+1}个性别："),input(f"请输入第{i+1}个身高：")]
    cursor.execute(sql,param)
    con.commit()

cursor.close() # 控制台关闭
con.close() # 连接的关闭